package com.cmict.data.bpm.service.task;

import com.cmict.data.bpm.controller.admin.task.vo.task.CommentVo;
import org.springframework.stereotype.Service;

/**
 * @author liutao
 * @date 2022/4/7
 */
@Service
public class FlowableCommentServiceImpl extends BaseProcessService implements IFlowableCommentService {

//    @Autowired
//    private IFlowableCommentDao flowableCommentDao;

    @Override
    public void addComment(CommentVo comment) {
        managementService.executeCommand(new AddHisCommentCmd(comment.getTaskId(), comment.getUserId(), comment.getProcessInstanceId(),
                comment.getType(), comment.getMessage()));
    }

//    @Override
//    public List<CommentVo> getFlowCommentVosByProcessInstanceId(String processInstanceId) {
//        List<CommentVo> datas = flowableCommentDao.getFlowCommentVosByProcessInstanceId(processInstanceId);
//        datas.forEach(commentVo -> {
//            commentVo.setTypeName(BpmProcessInstanceActionsEnum.getEnumMsgByType(commentVo.getType()));
//        });
//        return datas;
//    }
}

